[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 coreleft()              Return a Measure of Unused Memory

 #include   <alloc.h>
 #include   <stdlib.h>

 unsigned   coreleft(void);              In tiny, small, and medium models
 or
 unsigned long coreleft(void);           In compact, large, and huge models

    coreleft() returns the number of bytes of unused memory; this result
    varies according to the size of the memory model.

       Returns:     In small models, the amount of unused memory between
                    the stack and the data segment, minus 256 bytes is
                    returned.  In the large data models, the amount
                    between the heap and the stack is returned.

   -------------------------------- Example ---------------------------------

    The following statements display the amount of memory left.

           #include <stdio.h>      /* for printf */
           #include <alloc.h>      /* for coreleft */

           main()
           {
              unsigned long coresize;

               coresize = (unsigned long) coreleft();  /* for all models */
               printf("There are %ld bytes available\n",coresize);
           }


See Also: allocmem() calloc() farmalloc() free() malloc()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson